package com.topisv.tms.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.Department;

public interface DepartmentDao extends PagingAndSortingRepository<Department, Long>, JpaSpecificationExecutor<Department> {

	List<Department> findByStatus(String status);
	
	@Modifying
	@Query("select f from Department f where f.status = ?")
	List<Department> findMenu(String status);

	@Modifying
	@Query("select dept from Department dept where dept.department.id = ?1")
	List<Department> getSubDepartmentByid(Long id);
}
